/*
 * main.cpp
 *
 *  Created on: Nov 4, 2011
 *      Author: Mat Comeau
 */

#include "ArdyCore/WProgram.h"
#include "ArdyCore/NewSoftSerial.h"

#include "GPSSerial.h"


extern "C" {
#include "Venus634.h"
}


//using namespace std;

NewSoftSerial comPort(6,7);

//void venus634_init(void *begin, void *write);

//void venus634_process(void *ptAvailable, void *ptRead);


//===========================
void setup()
  {
  //Serial.begin(9600); // open the serial port at 9600 bps:
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);

  comPort.begin(9600);

  venus634_init(begin, write);
  }

//===========================
void loop()
  {
	int x, y, z;
	if(available()==1){
		venus634_process(available, read, &x, &y, &z);

		comPort.println((char)x);
		comPort.println((char)y);
		comPort.println((char)z);
		comPort.println("Updated location");
	}

  }



//===========================
int main()
  {
  init();
  setup();
  for (;;)
    {
    loop();
    }
  return 0;
  }
